package com.rxmvp.rxjavademo;

import android.app.Application;

import com.rxmvp.rxjavademo.RxRetrofit.RetrofitClient;

/**
 * Created by Administrator on 2017/1/8.
 */

public class App extends Application {

    private static App mApp;

    private static MainActivity.NetService service;

    @Override
    public void onCreate() {
        super.onCreate();
        mApp = this;

//        OkHttpClient client = new OkHttpClient.Builder()
//                .connectTimeout(5000, TimeUnit.MILLISECONDS)
//                .build();
//        Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().createClient();
//        Retrofit retrofit = new Retrofit.Builder()
//                .client(client)
//                .addConverterFactory(GsonConverterFactory.createClient(gson))
//                .addCallAdapterFactory(RxJavaCallAdapterFactory.createClient())
////                .baseUrl("http://f.hiphotos.baidu.com/")
//                .baseUrl("http://v.juhe.cn/")
//                .build();
        service = RetrofitClient.getInstance().createClient(this).create(MainActivity.NetService.class);

    }

    public static App getApp(){
        return mApp;
    }

    public static MainActivity.NetService  getService(){
        return service;
    }

}
